<include file="Tpl/Public/admin_top.html">
<form name="form" action="__APP__/admin{url}domailset{shtml}" method="post">
	<table width=98% height="auto" cellspacing=0 cellpadding=0 border=1 style="margin:auto;border:1px solid #ccc">
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="40" colspan="3" style="line-height:40px;background:url('{site}/Public/images/topbg.jpg')"><span style="font-size:16px;text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.6);color:#333;font-weight:bold;">注册激活配置</span></td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="30" width="150"><input type="radio" name="reg" value="1" onchange="change(1)" <?php if("{config->register_mode}"==1){echo 'checked';} ?>>使用SMTP激活</td>
			<td height="30" width="120"><input type="radio" name="reg" id="reg2" value="2" onchange="change(2)" <?php if("{config->register_mode}"==2){echo 'checked';} ?>>使用验证码</td>
			<td height="30"><input type="radio" name="reg" id="reg3" value="3" onchange="change(3)" <?php if("{config->register_mode}"==3){echo 'checked';} ?>>使用mail()函数</td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="30" width="120" style="line-height:30px;font-size:15px;color:#222;">SMTP邮件服务器</td>
			<td height="30" colspan="2"><input type="text" name="host" style="width:60%" value="{mail_config->mail_Host}"></td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="30" width="120" style="line-height:30px;font-size:15px;color:#222;">邮箱账户</td>
			<td height="30" colspan="2"><input type="text" name="huser" style="width:60%" value="{mail_config->mail_Username}"></td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="30" width="120" style="line-height:30px;font-size:15px;color:#222;">邮箱密码</td>
			<td height="30" colspan="2"><input type="text" name="hpass" style="width:60%" value="{mail_config->mail_Password}"></td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="30" width="120" style="line-height:30px;font-size:15px;color:#222;">邮箱地址</td>
			<td height="30" colspan="2"><input type="text" name="ufrom" style="width:60%" value="{mail_config->mail_From}"></td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="30" width="120" style="line-height:30px;font-size:15px;color:#222;">发件人名称</td>
			<td height="30" colspan="2"><input type="text" name="uname" style="width:60%" value="{mail_config->mail_FromName}"></td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="30" width="120" style="line-height:30px;font-size:15px;color:#222;">邮件主题</td>
			<td height="30" colspan="2"><input type="text" name="utitle" style="width:60%" value="{mail_config->mail_Subject}"></td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="30" width="120" style="line-height:30px;font-size:15px;color:#222;">邮件内容</td>
			<td height="30" colspan="2"><input type="text" name="ucon" style="width:60%" value="{mail_config->mail_Body}"></td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="40" colspan="3" style="line-height:40px;background:url('{site}/Public/images/topbg.jpg')"><span style="font-size:16px;text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.6);color:#333;font-weight:bold;">初始注册用户组配置</span></td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="30" colspan="3">
				<?php
					if(!empty($this->array_two['user_group_data'])){	?>
						<select name="default_user_group" style="width:200px;"><option value="">--请选择--</option><?php
						foreach($this->array_two['user_group_data'] as $v){
							?>
							<option value="<?php echo $v['id'];?>" <?php if($this->C('default_user_group')==$v['id']) echo 'selected'; ?>><?php echo $v['name'];?></option>
						<?php
						}?>
					</select>
					<?php	}else{	?>
						尚未配置注册默认用户组，<a style="color:red" href="__APP__/admin{url}userGroup{shtml}">点击这里</a>进行设置
			<?php	}	?>	
			</td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="40" colspan="3" style="line-height:40px;background:url('{site}/Public/images/topbg.jpg')"><span style="font-size:16px;text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.6);color:#333;font-weight:bold;">初始未登陆用户组配置</span></td>
		</tr>
		<tr onmouseover="addClass(this)" onmouseout="removeClass(this)">
			<td height="30" colspan="3">
				<?php
					if(!empty($this->array_two['user_group_data'])){	?>
						<select name="not_log_in_user_group" style="width:200px;"><option value="">--请选择--</option><?php
						foreach($this->array_two['user_group_data'] as $v){
							?>
							<option value="<?php echo $v['id'];?>" <?php if($this->C('not_log_in_user_group')==$v['id']) echo 'selected'; ?>><?php echo $v['name'];?></option>
						<?php
						}?>
					</select>
					<?php	}else{	?>
						尚未配置未登陆用户默认用户组，<a style="color:red" href="__APP__/admin{url}user_group{shtml}">点击这里</a>进行设置
			<?php	}	?>	
			</td>
		</tr>
   <tr>
   		<input type="hidden" name="token" value="{token}">
		<td height="40" colspan="3" align="left"><input name="submit" type="submit" value="提交" class="button" /></td>
	</tr>
</table>
</form>
	<script>
	window.onload=function(){
		if(document.getElementById("reg2").checked){
		var inps=document.getElementsByTagName("input");
		for(var i=0;i<inps.length;i++){
					if(inps[i].type=='text'){
						inps[i].disabled=true;
					}
				}
		}
		if(document.getElementById("reg3").checked){
		var inps=document.getElementsByTagName("input");
		for(var i=0;i<inps.length;i++){
					if(inps[i].name=='host' || inps[i].name=='huser' || inps[i].name=='hpass'){
						inps[i].disabled=true;
					}else{
						inps[i].disabled=false;	
					}
				}
		}
	}
		var tr=document.getElementsByTagName("tr");
		for(var n=0;n<tr.length;n++)
		{
			if(n%2==0&&n!=0)
			{
				tr[n].className="tr0";	
			}else{
				tr[n].className="tr1";	
			}
		}
		function change(val){
			var inps=document.getElementsByTagName("input");
			if(val==2){
				for(var i=0;i<inps.length;i++){
					if(inps[i].type=='text'){
						inps[i].disabled=true;
					}
				}
			}else if(val==3){
				for(var i=0;i<inps.length;i++){
					if(inps[i].name=='host' || inps[i].name=='huser' || inps[i].name=='hpass'){
						inps[i].disabled=true;
					}else{
						inps[i].disabled=false;	
					}
				}
			}else{
				for(var i=0;i<inps.length;i++){
					if(inps[i].type=='text'){
						inps[i].disabled=false;
					}
				}
			}
		}
	</script>
</body>
</html>